Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Query Descriptor Visibility #911

Merged
merged 9 commits into from
May 14, 2019

Conversation

ryanrath
Copy link
Contributor

@ryanrath ryanrath commented May 2, 2019

NOTE: I apologize in advance for the large number of files in this PR. On the plus side, the vast majority of them are test artifact updates.

Description

Updated to allow query descriptors to control visibility

acl-config
Previously we only allowed statistics to determine if an acl_group_by record
was visible or not. But our config files seem to indicate that certain query
descriptors should be able to control their ability to be shown as well. To
support both of these use cases the processQueryDescriptors function in
acl-config has been updated to take into account the hide property defined
at the query descriptor level and the visible property defined at the
statistic level. The logic used to determine the final visibility of an
acl_group_by record is as follows.

  • By default all entries are shown
  • If visible is defined then we use it's value.
  • Else, if hide is defined then we use it's value.

Also, there was a minor refactor with the removal of the $enabled variable.
The $disable variable that it was based on was never going to be null, so it's
use could be replaced w/ just !$disable.

Acls
There was some minor cleanup done because it was determined that we always want
to have the visible column included, not just when a $statisticName is
provided.

This allowed us to move the $descripter->setShowMenu(...) from out of the
if(isset($statisticName)) { ... } guard so that all query descriptors
generated by this function will have their showMenu property populated.

These two sets of changes work together to allow us to control our UI state as
we expect to.

Motivation and Context

Being able to control the visibility of the group bys / statistics via ACLs is expected. This was specifically a problem on an XSEDE install due to the more complicated visibility requirements. In OpenXDMoD there are no group by's / statistics that are hidden via the ACLs so this was not caught there.

Tests performed

Manual Testing was performed:

  • Navigate to an XSEDE Dev install, for each of the following users perform the steps below: pub, usr, cc
  • Select the Usage Tab.
  • Ensure that the realms / group by's that are shown match user is allowed to see ( etc/roles.d/pub.json#query_descripters
    • Users and which entries should be hidden:
      • pub: Accounts
      • usr: Accounts, Allocations
      • cc: Accounts, Allocations

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project as found in the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@ryanrath ryanrath force-pushed the fix_query_descriptor_visibility branch 2 times, most recently from 2270daa to 0ac5259 Compare May 3, 2019 16:47
@ryanrath ryanrath added this to the 8.1.1 milestone May 3, 2019
@ryanrath ryanrath added the bug Bugfixes label May 3, 2019
@ryanrath ryanrath requested review from smgallo and plessbd May 3, 2019 17:14
@plessbd plessbd modified the milestones: 8.1.1, 8.5.0 May 6, 2019
** acl-config **
Previously we only allowed statistics to determine if an `acl_group_by` record
was visible or not. But our config files seem to indicate that certain query
descriptors should be able to control their ability to be shown as well. To
support both of these use cases the `processQueryDescriptors` function in
`acl-config` has been updated to take into account the `hide` property defined
at the query descriptor level and the `visible` property defined at the
statistic level. The logic used to determine the final visibility of an
`acl_group_by` record is as follows.

- By default all entries are shown
- If `visible` is defined then we use it's value.
- Else, if `hide` is defined then we use it's value.

Also, there was a minor refactor with the removal of the `$enabled` variable.
The `$disable` variable that it was based on was never going to be null, so it's
use could be replaced w/ just `!$disable`.

** Acls **
There was some minor cleanup done because it was determined that we always want
to have the `visible` column included, not just when a `$statisticName` is
provided.

This allowed us to move the `$descripter->setShowMenu(...)` from out of the
`if(isset($statisticName)) { ... }` guard so that all query descriptors
generated by this function will have their `showMenu` property populated.

These two sets of changes work together to allow us to control our UI state as
we expect to.
Fixing issues introduced by ubccr#897. Mostly it was just updating hard coded paths,
but there are a few places where the format of the expected data json files are
important ( ETLv2 Directory Scanner Tests ). This required re-formatting of the
affected files per their use case. The
The User Profile pops up to prompt the user to double check their email address.
This means that the ext-mask-msg will be present until the user clicks close,
thus causing a problem for the `Logout` step.
This is just the initial bootstrap commit for the new `get_menus` endpoint
integration tests.
Added tests for `controllers/user_interface.php/operation=get_menus` and for
`Acls::getDisabledMenus`. `get_menus` is the endpoint that provides the list of
of query descriptors visible to the user. While `getDisabledMenus` provides the
list of query descriptors that are disabled. This should provide us a with a set
of happy path tests for these two sets of functionality that can later be
expanded upon as needed.
@ryanrath ryanrath force-pushed the fix_query_descriptor_visibility branch from 8a89bd5 to b540d23 Compare May 7, 2019 15:55
@ryanrath ryanrath mentioned this pull request May 8, 2019
6 tasks
@ryanrath ryanrath merged commit a7f96f1 into ubccr:xdmod8.5 May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bugfixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants